home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / as400 / vbx400dq / dqsample.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-25  |  9.9 KB  |  337 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "AS/400 Data Queue VBX"
  4.    ClientHeight    =   6795
  5.    ClientLeft      =   585
  6.    ClientTop       =   375
  7.    ClientWidth     =   7530
  8.    Height          =   7200
  9.    Icon            =   DQSAMPLE.FRX:0000
  10.    Left            =   525
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6795
  13.    ScaleWidth      =   7530
  14.    Top             =   30
  15.    Width           =   7650
  16.    Begin TextBox txtError 
  17.       Height          =   285
  18.       Left            =   5640
  19.       MaxLength       =   2
  20.       TabIndex        =   28
  21.       Text            =   "4"
  22.       Top             =   5640
  23.       Width           =   495
  24.    End
  25.    Begin Generic dq1 
  26.       DQ_Authority    =   0  'All 
  27.       DQ_Force        =   0  '0 = False 
  28.       DQ_Function     =   0  'None 
  29.       DQ_Length       =   0
  30.       DQ_Library      =   ""
  31.       DQ_Mode         =   0  'Translation & Peek Off
  32.       DQ_QueueName    =   ""
  33.       DQ_ReceiveWait  =   0
  34.       DQ_ReturnCode   =   0
  35.       DQ_SenderID     =   0  '0 = False 
  36.       DQ_Sequence     =   0  'LIFO 
  37.       DQ_SystemName   =   ""
  38.       DQ_Text         =   ""
  39.       Left            =   6960
  40.       Top             =   960
  41.    End
  42.    Begin TextBox txtSendData 
  43.       Height          =   285
  44.       Left            =   1920
  45.       MaxLength       =   4000
  46.       TabIndex        =   6
  47.       Top             =   2160
  48.       Width           =   4575
  49.    End
  50.    Begin TextBox txtSender 
  51.       Enabled         =   0   'False
  52.       Height          =   285
  53.       Left            =   120
  54.       MaxLength       =   152
  55.       TabIndex        =   27
  56.       Top             =   5640
  57.       Width           =   5295
  58.    End
  59.    Begin TextBox txtData 
  60.       Enabled         =   0   'False
  61.       Height          =   1215
  62.       Left            =   120
  63.       MaxLength       =   4000
  64.       MultiLine       =   -1  'True
  65.       TabIndex        =   7
  66.       Top             =   4080
  67.       Width           =   5415
  68.    End
  69.    Begin TextBox txtDQText 
  70.       Height          =   285
  71.       Left            =   1920
  72.       MaxLength       =   50
  73.       TabIndex        =   4
  74.       Top             =   1200
  75.       Width           =   4575
  76.    End
  77.    Begin CommandButton cmdStop 
  78.       Caption         =   "&Stop"
  79.       FontBold        =   -1  'True
  80.       FontItalic      =   0   'False
  81.       FontName        =   "Times New Roman"
  82.       FontSize        =   18
  83.       FontStrikethru  =   0   'False
  84.       FontUnderline   =   0   'False
  85.       Height          =   495
  86.       Left            =   2040
  87.       TabIndex        =   17
  88.       Top             =   6120
  89.       Width           =   1695
  90.    End
  91.    Begin TextBox txtMode 
  92.       Height          =   285
  93.       Left            =   1920
  94.       MaxLength       =   1
  95.       TabIndex        =   5
  96.       Top             =   1680
  97.       Width           =   255
  98.    End
  99.    Begin Frame Frame1 
  100.       Caption         =   "Data Queue Function"
  101.       Height          =   1095
  102.       Left            =   120
  103.       TabIndex        =   21
  104.       Top             =   2640
  105.       Width           =   5895
  106.       Begin OptionButton optPut 
  107.          Caption         =   "Put"
  108.          Height          =   255
  109.          Left            =   3360
  110.          TabIndex        =   13
  111.          Top             =   360
  112.          Width           =   855
  113.       End
  114.       Begin OptionButton optReceive 
  115.          Caption         =   "Receive Data"
  116.          Height          =   250
  117.          Left            =   1560
  118.          TabIndex        =   15
  119.          Top             =   720
  120.          Width           =   1500
  121.       End
  122.       Begin OptionButton optSend 
  123.          Caption         =   "Send Data"
  124.          Height          =   250
  125.          Left            =   1560
  126.          TabIndex        =   12
  127.          Top             =   360
  128.          Width           =   1500
  129.       End
  130.       Begin OptionButton optClear 
  131.          Caption         =   "Clear"
  132.          Height          =   255
  133.          Left            =   4440
  134.          TabIndex        =   11
  135.          Top             =   360
  136.          Width           =   1020
  137.       End
  138.       Begin OptionButton optDelete 
  139.          Caption         =   "Delete"
  140.          Height          =   250
  141.          Left            =   3360
  142.          TabIndex        =   10
  143.          Top             =   720
  144.          Width           =   1500
  145.       End
  146.       Begin OptionButton optCreate 
  147.          Caption         =   "Create "
  148.          Height          =   250
  149.          Left            =   120
  150.          TabIndex        =   9
  151.          Top             =   700
  152.          Width           =   1500
  153.       End
  154.       Begin OptionButton optSet 
  155.          Caption         =   "Set Mode"
  156.          Height          =   250
  157.          Left            =   120
  158.          TabIndex        =   8
  159.          Top             =   360
  160.          Width           =   1500
  161.       End
  162.    End
  163.    Begin CommandButton cmdRun 
  164.       Caption         =   "&Run"
  165.       FontBold        =   -1  'True
  166.       FontItalic      =   0   'False
  167.       FontName        =   "Times New Roman"
  168.       FontSize        =   18
  169.       FontStrikethru  =   0   'False
  170.       FontUnderline   =   0   'False
  171.       Height          =   495
  172.       Left            =   120
  173.       TabIndex        =   14
  174.       Top             =   6120
  175.       Width           =   1695
  176.    End
  177.    Begin TextBox txtDQLength 
  178.       Height          =   285
  179.       Left            =   5760
  180.       MaxLength       =   4
  181.       TabIndex        =   3
  182.       Top             =   720
  183.       Width           =   735
  184.    End
  185.    Begin TextBox txtSystemName 
  186.       Height          =   285
  187.       Left            =   1920
  188.       TabIndex        =   0
  189.       Top             =   240
  190.       Width           =   1575
  191.    End
  192.    Begin TextBox txtDQ 
  193.       Height          =   285
  194.       Left            =   1920
  195.       MaxLength       =   10
  196.       TabIndex        =   2
  197.       Top             =   720
  198.       Width           =   1575
  199.    End
  200.    Begin TextBox txtLibraryName 
  201.       Height          =   285
  202.       Left            =   5760
  203.       MaxLength       =   10
  204.       TabIndex        =   1
  205.       Top             =   240
  206.       Width           =   1575
  207.    End
  208.    Begin Label Label10 
  209.       Caption         =   "Data to Send"
  210.       Height          =   255
  211.       Left            =   120
  212.       TabIndex        =   25
  213.       Top             =   2160
  214.       Width           =   1695
  215.    End
  216.    Begin Label Label9 
  217.       Caption         =   "Sender Information"
  218.       Height          =   255
  219.       Left            =   120
  220.       TabIndex        =   26
  221.       Top             =   5400
  222.       Width           =   1695
  223.    End
  224.    Begin Label Label7 
  225.       Caption         =   "Data Queue Data"
  226.       Height          =   255
  227.       Left            =   120
  228.       TabIndex        =   24
  229.       Top             =   3840
  230.       Width           =   1695
  231.    End
  232.    Begin Label Label6 
  233.       Caption         =   "Data Queue Text :"
  234.       Height          =   255
  235.       Left            =   120
  236.       TabIndex        =   23
  237.       Top             =   1200
  238.       Width           =   1695
  239.    End
  240.    Begin Label Label5 
  241.       Caption         =   "Mode to Set"
  242.       Height          =   255
  243.       Left            =   120
  244.       TabIndex        =   22
  245.       Top             =   1680
  246.       Width           =   1215
  247.    End
  248.    Begin Label Label4 
  249.       Caption         =   "Data Queue Length :"
  250.       Height          =   255
  251.       Left            =   3840
  252.       TabIndex        =   20
  253.       Top             =   720
  254.       Width           =   2055
  255.    End
  256.    Begin Label Label3 
  257.       Caption         =   "System Name :"
  258.       Height          =   255
  259.       Left            =   120
  260.       TabIndex        =   19
  261.       Top             =   240
  262.       Width           =   2055
  263.    End
  264.    Begin Label Label2 
  265.       Caption         =   "Data Queue Name :"
  266.       Height          =   255
  267.       Left            =   120
  268.       TabIndex        =   18
  269.       Top             =   720
  270.       Width           =   1695
  271.    End
  272.    Begin Label Label1 
  273.       Caption         =   "Library Name :"
  274.       Height          =   255
  275.       Left            =   3840
  276.       TabIndex        =   16
  277.       Top             =   240
  278.       Width           =   1695
  279.    End
  280. Option Explicit
  281. Sub cmdRun_Click ()
  282.     DQ1.DQ_Library = txtLibraryName.Text
  283.     DQ1.DQ_QueueName = txtDQ.Text
  284.     DQ1.DQ_SystemName = txtSystemName.Text
  285.     DQ1.DQ_Text = txtDQText.Text
  286.     DQ1.DQ_SenderID = DQSenderNo
  287.     DQ1.DQ_Authority = DQAutAll
  288.     DQ1.DQ_Force = DQForceNo
  289.     If optSet.Value Then
  290.         DQ1.DQ_Mode = CInt(txtMode.Text)
  291.         DQ1.DQ_Function = DQSetMode
  292.         DQ1.Action = DQRun
  293.     End If
  294.     If optCreate.Value Then
  295.         DQ1.DQ_Length = CInt(txtDQLength.Text)
  296.         DQ1.DQ_Function = DQCreate
  297.         DQ1.Action = DQRun
  298.     End If
  299.     If optDelete.Value Then
  300.         DQ1.DQ_Function = DQDelete
  301.         DQ1.Action = DQRun
  302.     End If
  303.     If optClear.Value Then
  304.         DQ1.DQ_Function = DQClear
  305.         DQ1.Action = DQRun
  306.     End If
  307.     If optSend.Value Then
  308.         DQ1.DQ_SendData = RTrim(txtSendData.Text)
  309.         DQ1.DQ_Function = DQSend
  310.         DQ1.Action = DQRun
  311.     End If
  312.     If optPut.Value Then
  313.         DQ1.DQ_SendData = RTrim(txtSendData.Text)
  314.         DQ1.DQ_Function = DQPut
  315.         DQ1.Action = DQRun
  316.     End If
  317.     If optReceive.Value Then
  318.         DQ1.DQ_Function = DQReceive
  319.         DQ1.DQ_ReceiveWait = 5
  320.         DQ1.Action = DQRun
  321.         txtData = DQ1.DQ_ReceiveData
  322.         txtDQLength = CStr(DQ1.DQ_Length)
  323.     End If
  324.     If Len(LTrim(RTrim(DQ1.DQ_CPFMsgid))) > 0 Then
  325.         MsgBox "CPF Message : " + DQ1.DQ_CPFMsgid + Chr(10) + DQ1.DQ_ReturnMessage, 16, "Data Queue Error"
  326.     End If
  327.     txtError = CStr(DQ1.DQ_ReturnCode)
  328.     txtSender = DQ1.DQ_SenderInfo
  329.     DQ1.DQ_CPFMsgid = ""
  330. End Sub
  331. Sub cmdStop_Click ()
  332.     'Stop Conversation
  333.     DQ1.DQ_Function = DQStop
  334.     DQ1.Action = DQRun
  335.     End
  336. End Sub
  337.